home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 February
/
EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso
/
earcd
/
editor
/
aspell.lha
/
AlphaSpell
/
guess.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-08-29
|
2KB
|
44 lines
/**************************************************************************/
/* $VER: Guess.rexx 1.0 (29 Aug 1995) */
/**************************************************************************
This ARexx script uses AlphaSpell to guess at a word. If a wildcard pattern
is passed, it does pattern matching on the dictionaries. Otherwise, it uses
one of AlphaSpell's guessing routines. If an edit distance is passed as its
second argument, it guesses by measuring edit distances. Otherwise, it uses
a SoundEx method. This script is designed to be adapted for use with a text
editor. To adapt it, change the "SAY" command at the end to a statement for
inserting the word into the text of a document.
**************************************************************************/
IF EXISTS("libs:rexxarplib.library") THEN DO
IF ~SHOW("L","rexxarplib.library") THEN
CALL ADDLIB("rexxarplib.library",0,-30)
END
ELSE SAY "You need RexxArpLib.library"
PARSE ARG word k
k = strip(k)
IF VERIFY(word, "?*\[]!^", "Match") ~= 0 THEN
com = "AlphaSpell -Po T:List -d" GetENV("DDIR") "-w" word GetENV("Dict")
ELSE IF DATATYPE(k) = "NUM" THEN
com = "AlphaSpell -Go T:List -n" k "-d" GetENV("DDIR") "-w" word GetENV("Dict")
ELSE
com = "AlphaSpell -Go T:List -d" GetENV("DDIR") "-w" word GetENV("Dict")
ADDRESS COMMAND com
CALL Open(input,"T:List","R")
n = 0
DO UNTIL EOF(input)
n = n + 1
list.n = Readln(input)
END
CALL Close(input)
word = RequestList(1, n - 1, list, 100, 50, 300, 150,,"SORT")
SAY word
EXIT